<template>
  <div class="todolist">
    <ipt @getVal="add"></ipt><btn title="搜索"></btn>
    <check title="全选"></check>
    <div class="list">
      <item
        v-for="(val, idx) in listData"
        :title="val.title"
        :check="val.check"
        :index="idx"
        :key="idx"
      ></item>
    </div>
  </div>
</template>

<script>
import ipt from '@/components/ipt.vue'
import check from '@/components/check.vue'
import btn from '@/components/btn.vue'
import item from '@/components/item.vue'

export default {
  name: 'TodoList',
  components: {
    ipt, check, btn, item
  },
  data () {
    return {
      listData: [{
        title: '今天天气不错',
        flag: false
      }]
    }
  },
  methods: {
    add (v) {
      this.listData.push({
        title: v,
        flag: false
      })
    }
  }
}
</script>

<style scoped lang="less">
</style>
